const acl = require("express-acl");

module.exports = (db) => {
  const rules = db.get("rules").value();
  acl.config({
    rules,
    decodedObjectName: "auth",
  });
  return [acl.authorize.unless({ path: ["/login", "/init"] })];
};
